
function open(){
    buttonlist = document.getElementsByTagName("button")
    for(var i = 0; i < buttonlist.length; i++){
        if(buttonlist[i].children.length > 0 && buttonlist[i].children[0].innerText == "已同意"){

            buttonlist[i].children[0].innerText = "已同意"
            buttonlist[i].disabled = true
            var v = document.getElementsByName(buttonlist[i].name)[1].style.visibility = "hidden"
        }
    }
}

function  agree(button) {
    var id = button.name
    button.innerText = "已同意"
    button.classList.add("disabled")
    $.ajax({
        type:"post",
        url:"/general/agreeComLeaveItem",
        data:{"cid":id},
        dateType:"json",
        success:function (result) {

            if(result.data){
               window.location="/general/agreecomleave"
            }
        }
    })
    console.info(id)
}
function  refuse(button) {
    var id = button.name
    console.info(id)
}